<?php

class Billets
{
    public function __construct() { }
    

    public static function GetById($id)
    {
        if (! empty($id))
        {
            $rq = SQL::query('SELECT * FROM billets WHERE post_id='.$id.'');

            $res = SQL::assoc($rq);
        }
        return $res;
    }
	
	public static function GetAll()
	{
		$billets = array();
		$rq = SQL::query('SELECT * FROM billets ORDER BY post_id DESC');
		$rs = SQL::assoc($rq);
        $billets[] = $rs;
		return $rs;
	}
}
$posts = new Billets();